Write-Host "正在启动知识问答系统Web后台管理页面..." -ForegroundColor Green
Write-Host ""

# 切换到Web项目目录
$projectPath = Join-Path $PSScriptRoot "src\KnowledgeQA.Web"
Set-Location $projectPath

Write-Host "当前目录: $(Get-Location)" -ForegroundColor Yellow
Write-Host ""

# 编译项目
Write-Host "正在编译项目..." -ForegroundColor Cyan
dotnet build
if ($LASTEXITCODE -ne 0) {
    Write-Host "编译失败，请检查错误信息" -ForegroundColor Red
    Read-Host "按回车键退出"
    exit 1
}

Write-Host ""
Write-Host "编译成功，正在启动Web服务..." -ForegroundColor Green
Write-Host ""
Write-Host "项目启动后，请访问以下地址：" -ForegroundColor Yellow
Write-Host "- 后台管理: http://localhost:5001" -ForegroundColor Cyan
Write-Host "- 知识库管理: http://localhost:5001/Home/Knowledge" -ForegroundColor Cyan
Write-Host "- 智能问答: http://localhost:5001/Home/Chat" -ForegroundColor Cyan
Write-Host "- 系统设置: http://localhost:5001/Home/Settings" -ForegroundColor Cyan
Write-Host ""
Write-Host "注意：此模式仅启动Web界面，API功能需要单独启动API服务" -ForegroundColor Yellow
Write-Host ""
Write-Host "按 Ctrl+C 停止项目" -ForegroundColor Red
Write-Host ""

# 启动项目
dotnet run

Read-Host "按回车键退出" 